package com.wtwd.campus.vcom.service;

import com.alibaba.fastjson.JSONArray;
import com.wtwd.campus.entity.LocationDataVo;
import com.wtwd.campus.vcom.common.ResponseEntity;
import com.wtwd.campus.vcom.entity.VcomPhoneData;
import com.wtwd.campus.vcom.entity.VcomRequestRecord;

import java.util.List;

/**
 * @Author: ldaoliang
 * @DateTime: 2022/1/5 13:35
 * @Description:
 */
public interface VcomDeviceInfoService {

    /**
     * 获取设备最新一条定位数据
     *
     * @param imei
     * @return
     */
    LocationDataVo getDeviceLatestLocation(String imei);

    /**
     * 设置号码
     *
     * @param action
     * @param commandValue
     * @param imei
     * @return
     */
    ResponseEntity setPhoneData(String action, String commandValue, String imei);

    /**
     * 发送免打扰
     *
     * @param vcomRequestRecord
     * @return
     */
    ResponseEntity setNotDisturbData(VcomRequestRecord vcomRequestRecord);

    /**
     * 处理免打扰的应答
     *
     * @param imei
     * @param commandNumber
     */
    boolean dealNotDisturbReply(String imei, String commandNumber);

    /**
     * 处理失败的免打扰指令
     *
     * @param imei
     * @param commandNumber
     * @return
     */
    boolean dealFailedDotDisturb(String imei, String commandNumber);

    /**
     * 发送消息
     *
     * @param vcomRequestRecord
     * @return
     */
    ResponseEntity sendMessage(VcomRequestRecord vcomRequestRecord);

    /**
     * 发送短消息
     *
     * @param vcomRequestRecord
     * @return
     */
    ResponseEntity sendShortMessage(VcomRequestRecord vcomRequestRecord);

    /**
     * 用于再receiver中调用下发指令
     *
     * @param array
     * @param vcomRequestRecord
     * @return
     */
    ResponseEntity useDealWhiteNo(JSONArray array, VcomRequestRecord vcomRequestRecord);

    /**
     * 用于再receiver中调用下发指令
     *
     * @param array
     * @param vcomRequestRecord
     * @return
     */
    ResponseEntity useDealFamilyNo(JSONArray array, VcomRequestRecord vcomRequestRecord);

    /**
     * 用于再receiver中调用下发指令
     *
     * @param object
     * @param vcomRequestRecord
     * @return
     */
    ResponseEntity useDealSos(JSONArray object, VcomRequestRecord vcomRequestRecord);

    /**
     * 获取一个设备的所有类型的号码
     *
     * @return
     */
    List<VcomPhoneData> getPhoneDataByImei(String imei);

    /**
     * 根据imei恢复设备出厂设置
     *
     * @param imei
     * @return
     */
    boolean factoryDataReset(String imei, String commandNumber);

    /**
     * 获取设备是否在线
     *
     * @param imei
     * @return
     */
    boolean getDeviceOnline(String imei);

    /**
     * 根据imei 和请求id查询指令状态
     * @param imei
     * @param requestId
     * @return
     */
    VcomRequestRecord getInstructionState(String imei, String requestId);
}
